package com.boang.controller;

import com.boang.domain.Role;
import com.boang.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/*
  @author: 13813
  @date: 2024/8/13 10:54
*/
@Controller
@RequestMapping("/role")
public class RoleController {

    @Autowired
    private RoleService roleService;

    @PreAuthorize("hasRole('sys')")
    @RequestMapping("/getRoleList")
    public String getRoleList(ModelMap modelMap) {
        List<Role> list = roleService.list();
        modelMap.put("roleList", list);
        return "role_list";
    }
}
